//
//  HLVideoListRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/5/31.
//

#import "HLVideoListRequest.h"
#import "HLUserVideoListRequest.h"

@implementation HLVideoListRequest


- (NSString *)requestUrl
{
    return @"/online/user/short/video";
}

- (YTKRequestMethod)requestMethod
{
    return YTKRequestMethodGET;
}

- (id)requestArgument
{
    return @{@"pageNum":@(self.page), @"pageSize":HLListPageSize};
}

- (NSArray <HLUserVideoModel *> *)videoList
{
    NSArray *lists = @[];
    
    NSDictionary *data = [self.result valueForKey:@"data"];
    if (![data isKindOfClass:[NSDictionary class]]){
        return lists;
    }
    
    NSArray *records = [data valueForKey:@"records"];
    
    if([HLRunTime shareInstance].isFood){
        records = [HLUserVideoListRequest datas];
    }
    
    if (records.count > 0) {
       lists = [HLUserVideoModel mj_objectArrayWithKeyValuesArray:records];
    }
    
    return lists;
}


@end
